window: Drop gtk_window_set_attached_to
authorMatthias Clasen <mclasen@redhat.com>
Sat, 14 Mar 2020 05:59:22 +0000 (01:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 14 Mar 2020 06:00:10 +0000 (02:00 -0400)
We are no longer attaching windows to widgets.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkwidget.c
gtk/gtkwindow.c
gtk/gtkwindow.h

index 9f210d7402d0b6907a0a2ade09a10854d4e454cc..13b3f831f6a9069c4c400921fa28911ca443d904 100644 (file)
@@ -4260,7 +4260,6 @@ gtk_window_set_default_size
 gtk_window_set_hide_on_close
 gtk_window_get_hide_on_close
 gtk_window_set_transient_for
-gtk_window_set_attached_to
 gtk_window_set_destroy_with_parent
 gtk_window_set_display
 gtk_window_is_active
@@ -4307,7 +4306,6 @@ gtk_window_get_modal
 gtk_window_get_size
 gtk_window_get_title
 gtk_window_get_transient_for
-gtk_window_get_attached_to
 gtk_window_get_accept_focus
 gtk_window_get_focus_on_map
 gtk_window_get_group
index 610f5262093f65c9c8641793c931319f88051921..634a50dbea260c90026a40c99601c7290e846e16 100644 (file)
@@ -7418,9 +7418,6 @@ gtk_widget_dispose (GObject *object)
 
   g_object_set_qdata (object, quark_action_muxer, NULL);
 
-  while (priv->attached_windows)
-    gtk_window_set_attached_to (priv->attached_windows->data, NULL);
-
   G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
 }
 
index 8442fd53a95f14f99a34308bc11a34ad924adca0..696597e00b9281488e2dd01f8ac321d21cd9ff04 100644 (file)
@@ -308,7 +308,6 @@ enum {
   PROP_DECORATED,
   PROP_DELETABLE,
   PROP_TRANSIENT_FOR,
-  PROP_ATTACHED_TO,
   PROP_APPLICATION,
   PROP_DEFAULT_WIDGET,
 
@@ -993,24 +992,6 @@ gtk_window_class_init (GtkWindowClass *klass)
                            GTK_TYPE_WINDOW,
                            GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_EXPLICIT_NOTIFY);
 
-  /**
-   * GtkWindow:attached-to:
-   *
-   * The widget to which this window is attached.
-   * See gtk_window_set_attached_to().
-   *
-   * Examples of places where specifying this relation is useful are
-   * for instance a #GtkMenu created by a #GtkComboBox, a completion
-   * popup window created by #GtkEntry or a typeahead search entry
-   * created by #GtkTreeView.
-   */
-  window_props[PROP_ATTACHED_TO] =
-      g_param_spec_object ("attached-to",
-                           P_("Attached to Widget"),
-                           P_("The widget where the window is attached"),
-                           GTK_TYPE_WIDGET,
-                           GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_EXPLICIT_NOTIFY);
-
   window_props[PROP_IS_MAXIMIZED] =
       g_param_spec_boolean ("is-maximized",
                             P_("Is maximized"),
@@ -1965,9 +1946,6 @@ gtk_window_set_property (GObject      *object,
     case PROP_TRANSIENT_FOR:
       gtk_window_set_transient_for (window, g_value_get_object (value));
       break;
-    case PROP_ATTACHED_TO:
-      gtk_window_set_attached_to (window, g_value_get_object (value));
-      break;
     case PROP_APPLICATION:
       gtk_window_set_application (window, g_value_get_object (value));
       break;
@@ -2056,9 +2034,6 @@ gtk_window_get_property (GObject      *object,
     case PROP_TRANSIENT_FOR:
       g_value_set_object (value, gtk_window_get_transient_for (window));
       break;
-    case PROP_ATTACHED_TO:
-      g_value_set_object (value, gtk_window_get_attached_to (window));
-      break;
     case PROP_APPLICATION:
       g_value_set_object (value, gtk_window_get_application (window));
       break;
@@ -3169,77 +3144,6 @@ gtk_window_get_transient_for (GtkWindow *window)
   return priv->transient_parent;
 }
 
-/**
- * gtk_window_set_attached_to:
- * @window: a #GtkWindow
- * @attach_widget: (allow-none): a #GtkWidget, or %NULL
- *
- * Marks @window as attached to @attach_widget. This creates a logical binding
- * between the window and the widget it belongs to, which is used by GTK+ to
- * propagate information such as styling or accessibility to @window as if it
- * was a children of @attach_widget.
- *
- * Examples of places where specifying this relation is useful are for instance
- * a #GtkMenu created by a #GtkComboBox, a completion popup window
- * created by #GtkEntry or a typeahead search entry created by #GtkTreeView.
- *
- * Note that this function should not be confused with
- * gtk_window_set_transient_for(), which specifies a window manager relation
- * between two toplevels instead.
- *
- * Passing %NULL for @attach_widget detaches the window.
- **/
-void
-gtk_window_set_attached_to (GtkWindow *window,
-                            GtkWidget *attach_widget)
-{
-  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
-  g_return_if_fail (GTK_IS_WINDOW (window));
-  g_return_if_fail (GTK_WIDGET (window) != attach_widget);
-
-  if (priv->attach_widget == attach_widget)
-    return;
-
-  remove_attach_widget (window);
-
-  priv->attach_widget = attach_widget;
-
-  if (priv->attach_widget)
-    {
-      _gtk_widget_add_attached_window (priv->attach_widget, window);
-    }
-
-  /* Update the style, as the widget path might change. */
-  if (priv->attach_widget)
-    gtk_css_node_set_parent (gtk_widget_get_css_node (GTK_WIDGET (window)),
-                             gtk_widget_get_css_node (priv->attach_widget));
-  else
-    gtk_css_node_set_parent (gtk_widget_get_css_node (GTK_WIDGET (window)), NULL);
-
-  g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ATTACHED_TO]);
-}
-
-/**
- * gtk_window_get_attached_to:
- * @window: a #GtkWindow
- *
- * Fetches the attach widget for this window. See
- * gtk_window_set_attached_to().
- *
- * Returns: (nullable) (transfer none): the widget where the window
- * is attached, or %NULL if the window is not attached to any widget.
- **/
-GtkWidget *
-gtk_window_get_attached_to (GtkWindow *window)
-{
-  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
-  g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
-
-  return priv->attach_widget;
-}
-
 /**
  * gtk_window_get_application:
  * @window: a #GtkWindow
index 2a8d77a5cfac8c6a5c5e4788936c3179760174d3..7e08b9d78d5de607c57049c0fd80e91e8f588261 100644 (file)
@@ -119,11 +119,6 @@ void       gtk_window_set_transient_for        (GtkWindow           *window,
 GDK_AVAILABLE_IN_ALL
 GtkWindow *gtk_window_get_transient_for        (GtkWindow           *window);
 GDK_AVAILABLE_IN_ALL
-void       gtk_window_set_attached_to          (GtkWindow           *window,
-                                                GtkWidget           *attach_widget);
-GDK_AVAILABLE_IN_ALL
-GtkWidget *gtk_window_get_attached_to          (GtkWindow           *window);
-GDK_AVAILABLE_IN_ALL
 void       gtk_window_set_accept_focus         (GtkWindow           *window,
                                                 gboolean             setting);
 GDK_AVAILABLE_IN_ALL